<template>
  <yt-page title="事故总结" scroll>
    <yt-card title="事故调查报告">
      <yt-cell label="事故类型" :value="item.accident_type"></yt-cell>
      <yt-cell label="事故地点" :value="item.accident_place"></yt-cell>
      <yt-textarea title="初步原因" type="column" v-model="item.preliminary_cause" disabled></yt-textarea>
      <yt-textarea title="简要经过" type="column" v-model="item.things_go_through" disabled></yt-textarea>
      <yt-textarea title="事故评价" type="column" v-model="item.accident_evaluation" disabled></yt-textarea>
      <yt-textarea title="事故性质" type="column" v-model="item.nature" disabled></yt-textarea>
      <yt-textarea title="处理情况" type="column" v-model="item.treatmentSituation" disabled></yt-textarea>
      <yt-textarea title="处理情况" type="column" v-model="item.treatmentSituation" disabled></yt-textarea>
    </yt-card>
    <yt-card title="伤亡人数统计">
      <yt-cell label="直接财产损失" labelWidth="60%" :value="item.direct_loss"></yt-cell>
      <yt-cell label="间接财产损失" labelWidth="60%" :value="item.indirect_losses"></yt-cell>
      <yt-cell label="死亡人数" :value="item.Casualty"></yt-cell>
      <yt-cell label="重伤人数" :value="item.serious_injuryc"></yt-cell>
      <yt-cell label="失踪人数" :value="item.missing_number"></yt-cell>
      <yt-cell label="被疏散人数" :value="item.evacuate"></yt-cell>
      <yt-cell label="疏散地点" :value="item.evacuate_place"></yt-cell>
      <yt-textarea title="撤离情况" type="column" v-model="item.evacuate" disabled></yt-textarea>
      <yt-textarea title="环境影响" type="column" v-model="item.contaminated" disabled></yt-textarea>
      <yt-textarea title="协调事项" type="column" v-model="item.help" disabled></yt-textarea>
    </yt-card>
    <yt-card title="匹配预案">
      <yt-cell label="预案名称" :value="item.programme_name"></yt-cell>
      <yt-cell label="预案类型" :value="item.programme_type"></yt-cell>
      <yt-cell label="编制时间" :value="item.OrganizationTime"></yt-cell>
      <yt-cell label="事发危险源" :value="item.hazard_source"></yt-cell>
      <yt-cell label="事发危险物" :value="item.dangerous_substance"></yt-cell>
    </yt-card>
    <yt-card title="报告人信息">
      <yt-cell label="所在部门" :value="item.text"></yt-cell>
      <yt-cell label="姓名" :value="item.name"></yt-cell>
      <yt-cell label="职务" :value="item.post"></yt-cell>
      <yt-cell label="电话">
        <yt-cell-call :tel="item.telephone || ''"></yt-cell-call>
      </yt-cell>
    </yt-card>
    <yt-card title="附件">
      <yt-file v-model="item.file" :uploadFile="()=> {}" :disabled="true"></yt-file>
    </yt-card>
  </yt-page>
</template>

<script>
import { commonApi } from '@/common/api/commonApi.js'
import { ReplaceDictionary } from '@/common/utils/index.js'

export default {
  data() {
    return {
      item: {}
    }
  },
  activated() {
    this.initData()
  },
  methods: {
    async initData() {
      let p = [
        commonApi.dictionary('Accident_type'),
        commonApi.searchById('yj_emergency_information', this.$route.query.id)
      ]

      let [accidentTypeDic, item] = await Promise.all(p)

      this.item = ReplaceDictionary(item, {
        accident_type: accidentTypeDic,
        programme_type: accidentTypeDic
      })
    }
  }
}
</script>

<style scoped lang="stylus">
>>> .yt-card-body
  padding 0
</style>
